<?php 
$main_id = "";
$sub_id = "";
if(isset($_GET['main_id']))
	$main_id = $_GET['main_id'];
else
	$main_id = $default_main;

if(isset($_GET['sub_id']))
	$sub_id  = $_GET['sub_id'];

$sql = "SELECT * FROM fix_sub_products_type WHERE fix_main_products_type_id = $main_id";
$rsd = mysql_query($sql);
$selected = "";

$default_sub = 0;

while($row = mysql_fetch_array($rsd)){
	if($default_sub  == 0)
		$default_sub  = $row['fix_sub_products_type_id'];
	
	if($row['fix_sub_products_type_id'] == $sub_id)
		$selected = "selected=\"selected\"";
	else 
		$selected = "";
	echo "<option value=\"".$row['fix_sub_products_type_id']."\" $selected>".$row['fix_sub_products_type_name']."</option>";
}

?>